package com.enjoyor.soa.traffic.rest.tsms.dubbo.impl;

import org.springframework.stereotype.Component;

import com.alibaba.dubbo.config.annotation.Reference;
import com.enjoyor.soa.traffic.api.dto.tsms.TaskInfoDto;
import com.enjoyor.soa.traffic.api.service.dubbo.tsms.IDubboTaskInfoService;
import com.enjoyor.soa.traffic.rest.tsms.dubbo.ITaskInfoConsumeService;
import com.enjoyor.soa.traffic.util.pojo.Page;
import com.enjoyor.soa.traffic.util.pojo.ResultPojo;

@Component
public class TaskInfoConsumeService implements ITaskInfoConsumeService {

    @Reference(version = "1.0.0", timeout = 10000)
    //@Reference(version = "1.0.0", timeout = 10000, url="dubbo://192.168.56.8:21241")
    private IDubboTaskInfoService dubboTaskInfoService;
    
    @Override
    public ResultPojo selectTaskInfoById(String taskId) {
        return dubboTaskInfoService.selectTaskInfoById(taskId);
    }

	@Override
	public ResultPojo selectTaskInfoList(String taskId, String taskName, String schemeId, String taskRankId,
			String taskTypeId, String taskBeginTime, String taskEndTime, String startPlace, String targetPlace) {
		return dubboTaskInfoService.selectTaskInfoList(taskId, taskName, schemeId, taskRankId, taskTypeId,
				taskBeginTime, taskEndTime, startPlace, targetPlace);
	}

	@SuppressWarnings("rawtypes")
	@Override
	public ResultPojo selectTaskInfoPage(Page page, String taskId, String taskName, String schemeId, String taskRankId,
			String taskTypeId, String taskBeginTime, String taskEndTime, String startPlace, String targetPlace) {
		return dubboTaskInfoService.selectTaskInfoPage(page, taskId, taskName, schemeId, taskRankId, taskTypeId,
				taskBeginTime, taskEndTime, startPlace, targetPlace);
	}
    
    /**
	 * 根据执行任务编号查询执行任务信息
	 */
    @Override
    public ResultPojo selectExecuteTaskInfoById(String executeTaskId){
        return dubboTaskInfoService.selectExecuteTaskInfoById(executeTaskId);
    }
    
	/**
	 * 查询执行任务列表信息
	 */
	@Override
	public ResultPojo selectExecuteTaskBaseInfoList(String executeTaskId, String taskId, String taskName,
			String schemeId, String taskRankId, String taskTypeId, String beforeLicensePlate, String executeDate,
			String beginTime, String endTime, String startPlace, String targetPlace, String executeStatusId,
			String isWaitExecute) {
		return dubboTaskInfoService.selectExecuteTaskBaseInfoList(executeTaskId, taskId, taskName, schemeId, taskRankId,
				taskTypeId, beforeLicensePlate, executeDate, beginTime, endTime, startPlace, targetPlace,
				executeStatusId, isWaitExecute);
	};

	/**
	 * 查询执行任务详细列表信息
	 */
	@Override
	public ResultPojo selectExecuteTaskDetailInfoList(String executeTaskId, String taskId, String taskName,
			String schemeId, String taskRankId, String taskTypeId, String beforeLicensePlate, String executeDate,
			String beginTime, String endTime, String startPlace, String targetPlace, String executeStatusId,
			String isWaitExecute) {
		return dubboTaskInfoService.selectExecuteTaskDetailInfoList(executeTaskId, taskId, taskName, schemeId,
				taskRankId, taskTypeId, beforeLicensePlate, executeDate, beginTime, endTime, startPlace, targetPlace,
				executeStatusId, isWaitExecute);
	}

	/**
	 * 查询执行任务分页信息
	 * @param page
	 */
	@SuppressWarnings("rawtypes")
	@Override
	public ResultPojo selectExecuteTaskInfoPage(Page page, String executeTaskId, String taskId, String taskName,
			String schemeId, String taskRankId, String taskTypeId, String beforeLicensePlate, String executeDate,
			String beginTime, String endTime, String startPlace, String targetPlace, String executeStatusId,
			String isWaitExecute) {
		return dubboTaskInfoService.selectExecuteTaskInfoPage(page, executeTaskId, taskId, taskName, schemeId,
				taskRankId, taskTypeId, beforeLicensePlate, executeDate, beginTime, endTime, startPlace, targetPlace,
				executeStatusId, isWaitExecute);
	}
    
    @Override
    public ResultPojo insertTaskInfo(TaskInfoDto taskInfoDto, String userName) {
        return dubboTaskInfoService.insertTaskInfo(taskInfoDto, userName);
    }
    
    @Override
    public ResultPojo editTaskInfo(TaskInfoDto taskInfoDto, String userName) {
        return dubboTaskInfoService.editTaskInfo(taskInfoDto, userName);
    }
    
    @Override
    public ResultPojo editTaskBaseInfo(TaskInfoDto taskInfoDto, String userName) {
        return dubboTaskInfoService.editTaskBaseInfo(taskInfoDto, userName);
    }

    @Override
    public ResultPojo deleteTaskInfo(String taskId, String userName) {
        return dubboTaskInfoService.deleteTaskInfo(taskId, userName);
    }
    
    @Override
    public ResultPojo insertFastTaskInfo(TaskInfoDto taskInfoDto, String userName) {
        return dubboTaskInfoService.insertFastTaskInfo(taskInfoDto, userName);
    }
    
    @Override
    public ResultPojo editFastTaskInfo(TaskInfoDto taskInfoDto, String userName) {
        return dubboTaskInfoService.editFastTaskInfo(taskInfoDto, userName);

    }

    @Override
    public ResultPojo deleteFastTaskInfo(String taskId, String userName) {
        return dubboTaskInfoService.deleteFastTaskInfo(taskId, userName);
    }

	@Override
	public ResultPojo getTaskByTimeAndSchemeId(String schemeId, String date) {
		// TODO Auto-generated method stub
		return dubboTaskInfoService.getTaskByTimeAndSchemeId(schemeId, date);
	}
    
    
}
